/*
 * Author  : Pallab
 * Program : Shut.cxx
 *
 * 2011-12-28 19:30:02
 * I have not failed, I have just found 10000 ways that won't work.
 * http://mcpc.cigas.net/archives/2011/mcpc2011/shut/shut.html
 */
#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <iomanip>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define foR(i1,st,ed) for(int i1 = st , j1 = ed ; i1 < j1 ; ++i1 )
#define fo(i1,ed) foR( i1 , 0 , ed )
#define foE(i1,st,ed) foR( i1, st, ed+1 )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )

inline void wait(double seconds) {
    double endtime = clock()+(seconds * CLOCKS_PER_SEC);
    while (clock() < endtime) {
        ;
    }
}

inline int OR( int msk, int bit ) {
    return ( msk|(1<<bit) ) ;
}
inline int AND( int msk, int bit ) {
    return ( ( msk&(1<<bit) ) );
}
inline int XOR( int msk, int bit ) {
    return ( msk^(1<<bit) );
}
inline int bitcount( int msk ) {
    return __builtin_popcount(msk);
}

// template ends


const int maxn = 22;
const int maxv = 22;

int N,T;
int vi[ maxn+5 ];
int kase=1;

inline void Read() {
    fo(i,T) {
        CI( vi[i] );
    }
}
inline void debug( int curMsk) {
    for (int i=0;i<22;++i) {
        if ( AND(curMsk,i)!=0 ) {
            printf("%d ",i+1);
        }
    }
    printf("\n");
    sleep(1);
}
vector< vector<int> > E;

void pre() {
    int sum;
    E.assign(25,vector<int>());
    for (int i=1, k=(1<<22) ; i<k ;++i ) {
        sum=0;
        for ( int j=0;j<22;++j ) {
            if ( AND(i,j)!=0 ) {
                sum+=(j+1);
            }
            if ( sum>22 )goto L;
        }
        E[sum].pb(i);
L:
        ;

    }
}

inline bool nice(int msk, int curMsk) {
    if ( curMsk >= (1<<N) )return false;
    for (int i=0;i<N;++i) {
        if ( AND(msk,i)!=0 && AND(curMsk,i)!=0 ) {
            return false;
        }
    }
    return true;
}

#define PP pair<int, pair<int,int> >
inline void Proc() {
    set< PP, less<PP >  > pq;
    pq.insert( mk(0, mk(0,0) ) );

    int best = 0;
    while (pq.empty()==false ) {

        int picked = pq.begin()->s.f;
        int msk = pq.begin()->s.s;

        pq.erase( pq.begin() );
        best = max( best, bitcount(msk));
        if ( picked>=T )continue;
        fo(i,SZ( E[ vi[picked] ] )) {
            int pickedMsk = E[ vi[picked] ][i];
            // is all pickedMsk are uncked
            if ( nice(msk,pickedMsk) ) {
                // cout<<vi[picked]<<" ";debug(pickedMsk);sleep(1);
                int picked1 = picked+1;
                int msk1 = msk|pickedMsk;
                pq.insert( mk( bitcount(msk1), mk(picked1,msk1) ) );
            }
        }
    }
    cout<<"Game "<<kase<<": "<<best<<"\n";
}

int main() {
    pre();

    while ( scanf("%d %d",&N,&T)==2 ) {
        if ( N==0 && T==0 )break;
        Read();
        Proc();

        ++kase;
    }

    return 0;
}
// kate: indent-mode cstyle; space-indent on; indent-width 0; 

